#ifndef _SPOTIFY_PLUGIN_H_
#define _SPOTIFY_PLUGIN_H_

#define SPOTIFY_PLUGIN_API_VERSION_TEXT "0.1"
#define SPOTIFY_PLUGIN_API_VERSION 0x00000001

typedef void (*pf_log)(char * fmt, ...);

struct SpotifyTrack
{
  // Name of performing artist
  char artist[256];
  
  // Name of album which track appears on
  char album[256];
  
  // Track name
  char name[256];
  
  // Track length in seconds
  int length;
};

/*
  More or less an interface which all plugins must implement.
  The plugin manager will call a corresponding callback method for each
  event happening in the Spotify client. This invocation is synchronous and will
  block the client. All methods prefixed with 'On' are callback methods
*/
class SpotifyPlugin
{
public:
  virtual void OnLoad();
  virtual void OnUnload();
  
  // Plugin is responsible for free'ing incoming newTrack pointer
  virtual void OnTrackChanged(SpotifyTrack * newTrack);

  // Initialized by the plugin manager, available when OnLoad() has been called
  // FIXME: Not so pretty, handle it with OnLoad() ?
  pf_log log;

  // Yet to be implemented
  //virtual void OnPlaybackStarted();
  //virtual void OnPlaybackPaused();
  //virtual void OnPlaybackTime(int currentTime);
  //virtual void OnVolumeChanged(int newVolume);
};


#endif // _SPOTIFY_PLUGIN_H_